import * as _ from 'lodash';
import { resolveReflectiveProviders } from '@angular/core/src/di/reflective_provider';

export class PsMachineService {
    datas: Array<any> = [{
        name: '10.12.21.122',
        status: 'stopping',
        sn: 'az001',
        cabinet: '1号柜',
        cpu: 'Xeon E7-4809 v3 2GHz',
        memory: '32GB DDR4',
        standard: 'X86',
        brand: 'HP ProLiant DL580 G9',
        provider: '北京嘉城泰和科技有限公司',
        cpuuse: '50%',
        memoryuuse: '50%(16GB/32GB)',
        diskuse: '50%(50GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.145',
        status: 'running',
        sn: 'az002',
        cabinet: '2号柜',
        cpu: 'Xeon E7-4809 v3 2GHz',
        memory: '32GB DDR4',
        standard: 'X86',
        brand: 'HP ProLiant DL580 G9',
        provider: '北京嘉城泰和科技有限公司',
        cpuuse: '50%',
        memoryuuse: '25%(8GB/32GB)',
        diskuse: '30%(30GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.155',
        status: 'running',
        sn: 'az003',
        cabinet: '2号柜',
        cpu: 'Xeon E7-4809 v3 2GHz',
        memory: '32GB DDR4',
        standard: 'X86',
        brand: 'HP ProLiant DL580 G9',
        provider: '北京嘉城泰和科技有限公司',
        cpuuse: '50%',
        memoryuuse: '100%(32GB/32GB)',
        diskuse: '90%(90GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.165',
        status: 'running',
        sn: 'az004',
        cabinet: '3号柜',
        cpu: 'Xeon E7-4809 v3 2GHz',
        memory: '32GB DDR4',
        standard: 'X86',
        brand: 'HP ProLiant DL580 G9',
        provider: '北京嘉城泰和科技有限公司',
        cpuuse: '50%',
        memoryuuse: '75%(24GB/32GB)',
        diskuse: '20%(20GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.180',
        status: 'running',
        sn: 'az005',
        cabinet: '3号柜',
        cpu: 'Xeon E5-2630 V4 2.2GHz',
        memory: '32GB DDR4',
        standard: 'X86',
        brand: 'HP ProLiant DL388 Gen9',
        provider: '北京网络未来科技发展有限公司',
        cpuuse: '50%',
        memoryuuse: '50%(16GB/32GB)',
        diskuse: '60%(60GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.200',
        status: 'running',
        sn: 'az006',
        cabinet: '3号柜',
        cpu: 'Xeon E5-2630 V4 2.2GHz',
        memory: '32GB DDR4',
        standard: 'X86',
        brand: 'HP ProLiant DL388 Gen10',
        provider: '北京网络未来科技发展有限公司',
        cpuuse: '50%',
        memoryuuse: '50%(16GB/32GB)',
        diskuse: '40%(40GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.210',
        status: 'running',
        sn: 'az007',
        cabinet: '3号柜',
        cpu: 'POWER8 3.42GHz',
        memory: '64GB DDR3',
        standard: 'POWER',
        brand: 'IBM Power System S812L',
        provider: '北京普天时代信息技术有限公司',
        cpuuse: '50%',
        memoryuuse: '75%(48GB/64GB)',
        diskuse: '10%(10GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.212',
        status: 'running',
        sn: 'az008',
        cabinet: '3号柜',
        cpu: 'POWER8 3.42GHz',
        memory: '64GB DDR3',
        standard: 'POWER',
        brand: 'IBM Power System S812L',
        provider: '北京普天时代信息技术有限公司',
        cpuuse: '50%',
        memoryuuse: '25%(16GB/64GB)',
        diskuse: '20%(20GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.230',
        status: 'running',
        sn: 'az009',
        cabinet: '4号柜',
        cpu: 'POWER8 3.42GHz',
        memory: '64GB DDR3',
        standard: 'POWER',
        brand: 'IBM Power System S812L',
        provider: '北京普天时代信息技术有限公司',
        cpuuse: '50%',
        memoryuuse: '25%(16GB/64GB)',
        diskuse: '80%(80GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.231',
        status: 'running',
        sn: 'az010',
        cabinet: '4号柜',
        cpu: 'Xeon E5-2609 v3 1.9GHz',
        memory: '8GB DDR4',
        standard: 'X86',
        brand: '浪潮英信NF5270M4',
        provider: '北京英信未来科技有限公司',
        cpuuse: '50%',
        memoryuuse: '100%(8GB/8GB)',
        diskuse: '40%(40GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.232',
        status: 'running',
        sn: 'az011',
        cabinet: '5号柜',
        cpu: 'Xeon E5-2609 v3 1.9GHz',
        memory: '8GB DDR4',
        standard: 'X86',
        brand: '浪潮英信NF5270M5',
        provider: '北京英信未来科技有限公司',
        cpuuse: '50%',
        memoryuuse: '50%(4GB/8GB)',
        diskuse: '70%(70GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.233',
        status: 'running',
        sn: 'az012',
        cabinet: '5号柜',
        cpu: 'UltraSPARC T2 1.4GHz',
        memory: '32GB FB-DIMM',
        standard: 'SPARC',
        brand: 'Sun SPARC Enterprise T5240',
        provider: '北京华人方创科技有限公司',
        cpuuse: '50%',
        memoryuuse: '50%(16GB/32GB)',
        diskuse: '50%(50GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.234',
        status: 'running',
        sn: 'az013',
        cabinet: '5号柜',
        cpu: 'SPARC64 VII 2.75GHz',
        memory: '16GB ECC DDR2',
        standard: 'SPARC',
        brand: 'Sun SPARC Enterprise M3000',
        provider: '北京华人方创科技有限公司',
        cpuuse: '50%',
        memoryuuse: '100%(16GB/16GB)',
        diskuse: '92%(92GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.235',
        status: 'running',
        sn: 'az014',
        cabinet: '5号柜',
        cpu: 'Xeon E7-4809 v2 1.9GHz',
        memory: '32GB DDR3',
        standard: 'X86',
        brand: '联想System x3850 X6',
        provider: '北京鑫创科技有限公司',
        cpuuse: '50%',
        memoryuuse: '50%(16GB/32GB)',
        diskuse: '50%(50GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.236',
        status: 'running',
        sn: 'az015',
        cabinet: '5号柜',
        cpu: 'Xeon E7-4809 v2 1.9GHz',
        memory: '32GB DDR3',
        standard: 'X86',
        brand: '联想System x3850 X7',
        provider: '北京鑫创科技有限公司',
        cpuuse: '50%',
        memoryuuse: '25%(8GB/32GB)',
        diskuse: '33%(33GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.237',
        status: 'running',
        sn: 'az016',
        cabinet: '5号柜',
        cpu: 'Xeon E7-4809 v2 1.9GHz',
        memory: '32GB DDR3',
        standard: 'X86',
        brand: '联想System x3850 X8',
        provider: '北京鑫创科技有限公司',
        cpuuse: '50%',
        memoryuuse: '50%(16GB/32GB)',
        diskuse: '60%(60GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.238',
        status: 'running',
        sn: 'az017',
        cabinet: '5号柜',
        cpu: 'Xeon E5-2640 v4 2.4GHz',
        memory: '64GB RDIMM',
        standard: 'X86',
        brand: ' 戴尔PowerEdge R730',
        provider: '北京永昌高泰科技发展有限公司',
        cpuuse: '50%',
        memoryuuse: '25%(16GB/64GB)',
        diskuse: '100%(100GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.239',
        status: 'running',
        sn: 'az018',
        cabinet: '5号柜',
        cpu: 'Xeon E5-2640 v4 2.4GHz',
        memory: '64GB RDIMM',
        standard: 'X86',
        brand: ' 戴尔PowerEdge R731',
        provider: '北京永昌高泰科技发展有限公司',
        cpuuse: '50%',
        memoryuuse: '25%(16GB/64GB)',
        diskuse: '40%(40GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.240',
        status: 'running',
        sn: 'az019',
        cabinet: '5号柜',
        cpu: 'Xeon E5-2640 v4 2.4GHz',
        memory: '64GB RDIMM',
        standard: 'X86',
        brand: ' 戴尔PowerEdge R732',
        provider: '北京永昌高泰科技发展有限公司',
        cpuuse: '50%',
        memoryuuse: '25%(16GB/64GB)',
        diskuse: '76%(76GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.241',
        status: 'running',
        sn: 'az020',
        cabinet: '5号柜',
        cpu: 'Xeon E5-2640 v4 2.4GHz',
        memory: '64GB RDIMM',
        standard: 'X86',
        brand: ' 戴尔PowerEdge R733',
        provider: '北京永昌高泰科技发展有限公司',
        cpuuse: '50%',
        memoryuuse: '50%(32GB/64GB)',
        diskuse: '30%(30GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.242',
        status: 'running',
        sn: 'az021',
        cabinet: '5号柜',
        cpu: 'Xeon E7-4809 v2 1.9GHz',
        memory: '32GB DDR3',
        standard: 'X86',
        brand: '联想System x3850 X6',
        provider: '北京鑫创科技有限公司',
        cpuuse: '50%',
        memoryuuse: '25%(8GB/32GB)',
        diskuse: '25%(25GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.243',
        status: 'running',
        sn: 'az022',
        cabinet: '5号柜',
        cpu: 'Xeon E7-4809 v2 1.9GHz',
        memory: '32GB DDR3',
        standard: 'X86',
        brand: '联想System x3850 X7',
        provider: '北京鑫创科技有限公司',
        cpuuse: '50%',
        memoryuuse: '50%(16GB/32GB)',
        diskuse: '50%(50GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.244',
        status: 'running',
        sn: 'az023',
        cabinet: '5号柜',
        cpu: 'Xeon E5-2630 V4 2.2GHz',
        memory: '32GB DDR4',
        standard: 'X86',
        brand: 'HP ProLiant DL388 Gen9',
        provider: '北京网络未来科技发展有限公司',
        cpuuse: '50%',
        memoryuuse: '50%(16GB/32GB)',
        diskuse: '30%(30GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    },
    {
        name: '10.12.21.245',
        status: 'running',
        sn: 'az024',
        cabinet: '5号柜',
        cpu: 'Xeon E5-2630 V4 2.2GHz',
        memory: '32GB DDR4',
        standard: 'X86',
        brand: 'HP ProLiant DL388 Gen9',
        provider: '北京网络未来科技发展有限公司',
        cpuuse: '50%',
        memoryuuse: '75%(24GB/32GB)',
        diskuse: '10%(10GB/100GB)',
        warn: 1,
        startTime: 1518398634629,
        //endTime: 1518398634629,
        comment: ''
    }];
    // datas: Array<any> = [
    //     {
    //         name: '10.12.21.122',
    //         status: 'stopping',
    //         sn: 'az001',
    //         cabinet: '1号柜',
    //         cpu: '4核',
    //         memory: '8GB',
    //         cpuuse: '50%',
    //         memoryuuse: '50%(4GB/8GB)',
    //         diskuse: '70%(70GB/100GB)',
    //         warn: 1,
    //         startTime: 1518398634629,
    //         endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.145',
    //         status: 'running',
    //         sn: 'az002',
    //         cabinet: '2号柜',
    //         cpu: '2核',
    //         memory: '4GB',
    //         cpuuse: '50%',
    //         memoryuuse: '50%(2GB/4GB)',
    //         diskuse: '70%(70GB/100GB)',
    //         warn: 1,
    //         startTime: 1518398634629,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.155',
    //         status: 'running',
    //         sn: 'az003',
    //         cabinet: '2号柜',
    //         cpu: '2核',
    //         memory: '4GB',
    //         cpuuse: '50%',
    //         memoryuuse: '50%(2GB/4GB)',
    //         diskuse: '70%(70GB/100GB)',
    //         warn: 1,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.165',
    //         status: 'running',
    //         sn: 'az004',
    //         cabinet: '3号柜',
    //         cpu: '2核',
    //         memory: '4GB',
    //         cpuuse: '50%',
    //         memoryuuse: '50%(2GB/4GB)',
    //         diskuse: '70%(70GB/100GB)',
    //         warn: 1,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.180',
    //         status: 'running',
    //         sn: 'az005',
    //         cabinet: '3号柜',
    //         cpu: '2核',
    //         memory: '4GB',
    //         cpuuse: '80%',
    //         memoryuuse: '100%(4GB/4GB)',
    //         diskuse: '90%(90GB/100GB)',
    //         warn: 1,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.200',
    //         status: 'running',
    //         sn: 'az006',
    //         cabinet: '3号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '80%',
    //         memoryuuse: '100%(4GB/4GB)',
    //         diskuse: '90%(90GB/100GB)',
    //         warn: 1,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.210',
    //         status: 'running',
    //         sn: 'az007',
    //         cabinet: '3号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '80%',
    //         memoryuuse: '100%(4GB/4GB)',
    //         diskuse: '90%(90GB/100GB)',
    //         warn: 1,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.212',
    //         status: 'running',
    //         sn: 'az008',
    //         cabinet: '3号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '80%',
    //         memoryuuse: '100%(4GB/4GB)',
    //         diskuse: '90%(90GB/100GB)',
    //         warn: 1,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.230',
    //         status: 'running',
    //         sn: 'az009',
    //         cabinet: '4号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '20%',
    //         memoryuuse: '25%(1GB/4GB)',
    //         diskuse: '10%(10GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.231',
    //         status: 'running',
    //         sn: 'az010',
    //         cabinet: '4号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '20%',
    //         memoryuuse: '25%(1GB/4GB)',
    //         diskuse: '10%(10GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     }, {
    //         name: '10.12.21.232',
    //         status: 'running',
    //         sn: 'az011',
    //         cabinet: '5号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '20%',
    //         memoryuuse: '25%(1GB/4GB)',
    //         diskuse: '10%(10GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.233',
    //         status: 'running',
    //         sn: 'az012',
    //         cabinet: '5号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '20%',
    //         memoryuuse: '25%(1GB/4GB)',
    //         diskuse: '10%(10GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.234',
    //         status: 'running',
    //         sn: 'az013',
    //         cabinet: '5号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '20%',
    //         memoryuuse: '25%(1GB/4GB)',
    //         diskuse: '10%(10GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.235',
    //         status: 'running',
    //         sn: 'az014',
    //         cabinet: '5号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '20%',
    //         memoryuuse: '25%(1GB/4GB)',
    //         diskuse: '10%(10GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.236',
    //         status: 'running',
    //         sn: 'az015',
    //         cabinet: '5号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '20%',
    //         memoryuuse: '25%(1GB/4GB)',
    //         diskuse: '10%(10GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.237',
    //         status: 'running',
    //         sn: 'az016',
    //         cabinet: '5号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '20%',
    //         memoryuuse: '25%(1GB/4GB)',
    //         diskuse: '10%(10GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.238',
    //         status: 'running',
    //         sn: 'az017',
    //         cabinet: '5号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '20%',
    //         memoryuuse: '25%(1GB/4GB)',
    //         diskuse: '10%(10GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.239',
    //         status: 'running',
    //         sn: 'az018',
    //         cabinet: '5号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '20%',
    //         memoryuuse: '25%(1GB/4GB)',
    //         diskuse: '10%(10GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.240',
    //         status: 'running',
    //         sn: 'az019',
    //         cabinet: '5号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '20%',
    //         memoryuuse: '25%(1GB/4GB)',
    //         diskuse: '10%(10GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.241',
    //         status: 'running',
    //         sn: 'az020',
    //         cabinet: '5号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '20%',
    //         memoryuuse: '25%(1GB/4GB)',
    //         diskuse: '10%(10GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.242',
    //         status: 'running',
    //         sn: 'az021',
    //         cabinet: '5号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '20%',
    //         memoryuuse: '25%(1GB/4GB)',
    //         diskuse: '10%(10GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.243',
    //         status: 'running',
    //         sn: 'az022',
    //         cabinet: '5号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '20%',
    //         memoryuuse: '25%(1GB/4GB)',
    //         diskuse: '10%(10GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.244',
    //         status: 'running',
    //         sn: 'az023',
    //         cabinet: '5号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '40%',
    //         memoryuuse: '75%(3GB/4GB)',
    //         diskuse: '75%(75GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    //     {
    //         name: '10.12.21.245',
    //         status: 'running',
    //         sn: 'az024',
    //         cabinet: '5号柜',
    //         cpu: '4核',
    //         memory: '4GB',
    //         cpuuse: '40%',
    //         memoryuuse: '75%(3GB/4GB)',
    //         diskuse: '75%(75GB/100GB)',
    //         warn: 0,
    //         startTime: 1518521273035,
    //         //endTime: 1518398634629,
    //         comment: ''
    //     },
    // ];
    servers: Array<any> = [
        {
            standard: 'X86',
            brand: 'HP ProLiant DL580 G9',
            provider: '北京嘉城泰和科技有限公司',
            cpu: 'Xeon E7-4809 v3 2GHz',
            memory: '32GB DDR4'
        },
        {
            standard: 'X86',
            brand: 'HP ProLiant DL388 Gen9',
            provider: '北京网络未来科技发展有限公司',
            cpu: 'Xeon E5-2630 V4 2.2GHz',
            memory: '32GB DDR4'
        },
        {
            standard: 'X86',
            brand: '浪潮英信NF5270M4',
            provider: '北京英信未来科技有限公司',
            cpu: 'Xeon E5-2609 v3 1.9GHz',
            memory: '8GB DDR4'
        },
        {
            standard: 'X86',
            brand: 'HP ProLiant DL580 G9',
            provider: '北京嘉城泰和科技有限公司',
            cpu: 'Xeon E7-4809 v3 2GHz',
            memory: '32GB DDR4'
        },
        {
            standard: 'X86',
            brand: '联想System x3850 X6',
            provider: '北京鑫创科技有限公司',
            cpu: 'Xeon E7-4809 v2 1.9GHz',
            memory: '32GB DDR3'
        },
        {
            standard: 'X86',
            brand: '戴尔PowerEdge R730',
            provider: '北京永昌高泰科技发展有限公司',
            cpu: 'Xeon E5-2640 v4 2.4GHz',
            memory: '64GB RDIMM'
        },
        {
            standard: 'POWER',
            brand: 'IBM Power System S812L',
            provider: '北京普天时代信息技术有限公司',
            cpu: 'POWER8 3.42GHz',
            memory: '64GB DDR3'
        },
        {
            standard: 'SPARC',
            brand: 'Sun SPARC Enterprise T5240',
            provider: '北京华人方创科技有限公司',
            cpu: 'UltraSPARC T2 1.4GHz',
            memory: '32GB FB-DIMM'
        },
        {
            standard: 'X86',
            brand: 'HP ProLiant DL580 G9',
            provider: '北京嘉城泰和科技有限公司',
            cpu: 'Xeon E7-4809 v3 2GHz',
            memory: '32GB DDR4'
        }
    ]



    constructor() { }

    queryMachine(condition) {
        let list = _.cloneDeep(this.datas);
        let result = [];
        let findResult = [];
        if (!condition) {
            return list;
        }
        let search = condition.search;
        if (search != null) {
            for (let l of list) {
                if (l.name.indexOf(search) >= 0) {
                    result.push(l);
                }
            }
        } else {
            result = list;
        }

        if (condition.sort) {
            result = _.orderBy(result, [
                condition.sort.field
            ], [condition.sort.sort]);
        }

        let pageSize = condition.pageSize;
        if (pageSize == null) {
            pageSize = 10;
        }

        let pageNo = condition.pageNo;
        if (pageNo == null) {
            pageNo = 1;
        }

        for (let i = 0; i < result.length; i++) {
            if (i >= (pageNo - 1) * pageSize) {
                findResult.push(result[i]);
            }
            if (findResult.length >= pageSize) {
                break;
            }
        }

        return {
            data: findResult,
            totalCount: result.length
        };
    }

    getDetail(name: string): any {
        let index = Math.ceil(Math.random() * this.servers.length);
        let result = this.servers[index];
        if (result == null) {
            return this.servers[0];
        }
        return result;
    }
}